Component({
  properties: {
    index: {
      type: Number,
      observer (newVal, oldVal, changedPath) {
        let val = newVal < 10 ? `0${newVal}` : newVal
        this.setData({
          _index: val
        })
      }
    }
  },
  data: {
    months: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
    year: 0,
    month: '',
    _index: ''
  },
  lifetimes: {
    attached: function() {
      let date = new Date(),
          year = date.getFullYear(),
          month = date.getMonth()
      month = this.data.months[month]
      this.setData({
        year,
        month
      })
    }
  },
  methods: {

  }
})